home *** CD-ROM | disk | FTP | other *** search
/ System Booster / System Booster.iso / Archives / Timing / SPSTime.lha / SPSTime.doc next >
Encoding:
Text File  |  1992-02-22  |  2.5 KB  |  67 lines

  1.  
  2. TIME (and DATE too, but that name was taken...)
  3.  
  4. ©1991 David Plummer.
  5.  
  6. This  program is freely distributable software, on the condition
  7. that  the  executable  and documentation are distributed without
  8. modification,  and  all  copyright  notices are left intact.  No
  9. charge  may  be  made  for  distribution  other  than  a nominal
  10. handling  and  duplication  fee,  plus  handling costs.  Express
  11. permission is granted to Fred Fish to distribute this program in
  12. his software library.
  13.  
  14. All that for a time command?
  15.  
  16. WHY A TIME COMMAND
  17. ~~~~~~~~~~~~~~~~~~
  18. 1> I needed one.
  19. 2> I was tired of writing new scripts like echo "$(date)" FIRST 18
  20.    that quit working when I changed my shell weekly...
  21. 3> I wanted something highly configurable, that would print the
  22.    time and date in any particular format I wanted.
  23.  
  24. So here it is.  TIME can print the time and date, as well as any
  25. extra  text  in  the output string, in just about any format you
  26. could possibly imagine.
  27.  
  28. For example:  time -f "Today is %A, %B %d, %Y." gives...
  29.  
  30. Today is Wednesday, October 09, 1991.
  31.  
  32. Depending on what day it actually is, of course :-)
  33.  
  34. The format specifiers are:
  35.  
  36. ------------------------------------------------------------------------
  37. %a  abbreviated weekday name        %p  locale's equivalent of AM or PM
  38. %A  full weekday name               %S  second as a num (0-59)
  39. %b  abbreviated month name          %U  week-of-year, Sun first (0-52)
  40. %B  full month name                 %w  weekday as a num (0-6, Sun is 0)
  41. %c  standard date and time string   %W  week-of-year, Mon first (0-52)
  42. %d  day-of-month as a num (1-31)    %x  standard date string
  43. %H  hour (0-23)                     %X  standard time string [default]
  44. %I  hour (1-12)                     %y  year as num w/o century (00-99)
  45. %j  day-of-year as a num (1-366)    %Y  year as num w/ century
  46. %m  month as a num (1-12)           %Z  timezone name
  47. %M  minute as a num (0-59)          %%  the percent sign
  48. ------------------------------------------------------------------------
  49.  
  50. [ You know, ANSI C has a function just like this, too bad my LATTICE
  51.   compiler doesn't... then again, it doesn't have clock(), or mktime(),
  52.   or difftime(), or strftime()... at least in my version... sigh. ]
  53.  
  54.  
  55. Anyway, have fun, or at least as much fun as you can have with a
  56. time command.  If you have comments, suggestions, bug reports,
  57. or copious quantities of cash to send me, I can be reached at:
  58.  
  59. plummer@hercules.cs.uregina.ca
  60.  
  61. David Plummer
  62. 2326 Francis Street
  63. Regina, Saskacthewan
  64. S4N 2P7
  65. 1-306-352-0358
  66.  
  67.